package com.yykj.hospital.server.converter;


import com.yykj.hospital.client.dto.HotDoctorDTO;
import com.yykj.hospital.server.model.entity.HospitalDoctor;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

public class HotDoctorDTOConverter {
    public static HotDoctorDTO convert(HospitalDoctor hospitalDoctor){
        HotDoctorDTO dto = new HotDoctorDTO();
        BeanUtils.copyProperties(hospitalDoctor,dto);
        return dto;
    }

    public static List<HotDoctorDTO> convert(List<HospitalDoctor> list){
        return list.stream().map(HotDoctorDTOConverter::convert).collect(Collectors.toList());
    }
}
